/*
 * @FilePath: /vue-ts/src/router/index.ts
 * @Author: Yongchao Wang
 * @Date: 2020-09-13 22:03:58
 * @LastEditors: Yongchao Wang
 * @LastEditTime: 2020-09-16 22:40:19
 */
import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/index.vue'),
  },
  {
    path: '/',
    name: 'dash',
    component: () => import('../views/dashboard/dash.vue'),
    children: [
      {
        path: '/addarticle',
        name: 'addarticle',
        component: () => import('../views/article/addarticle.vue'),
      },
      {
        path: '/articlelist',
        name: 'articlelist',
        component: () => import('../views/article/articlelist.vue'),
      },
      {
        path: '/photo',
        name: 'photo',
        component: () => import('../views/article/photo.vue'),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
